package game.Menus;

import org.newdawn.slick.Graphics;
import org.newdawn.slick.geom.Vector2f;

import game.ActionListener;
import game.Config.Config;

/**
 * A text menu item contains and prints text.
 * @author Victor
 *
 */
public class TextMenuItem extends MenuItem{

	protected String text;
	/**
	 * Creates a new menu item.
	 * @param text The text the item will display.
	 * @param action The action the item will perform when called.
	 */
	public TextMenuItem(String text, ActionListener action) {
		super(action);
		this.text = text;
	}

	/**
	 * Prints the item to the screen at a given position.
	 */
	@Override
	public void print(Graphics graphic, Vector2f position, boolean selected) {
		if(selected){
			graphic.setColor(Config.SELECTED_COLOR);
		}
		graphic.drawString(text, position.x, position.y);
		graphic.setColor(Config.STANDARD_COLOR);
		
	}

}
